import request from '../utils/request';

export async function createProject(params) {
  return request('/project', {
    method: 'POST',
    body: params,
  });
}

export async function getProjectList(params) {
  let url = '/common/project/list';
  if (params !== undefined && params !== '') {
    url = `/common/project/list?name=${params}`;
  }
  return request(url);
}

export async function updateProject(params) {
  return request(`/project/${params.id}`, {
    method: 'PUT',
    body: params,
  });
}
export async function checkedCode(params) {
  return request(`/project/isUse/${params}`, {
    method: 'GET',
  });
}

export async function getLabels() {
  return request('/project/labels', {
    method: 'GET',
  });
}
export async function refreshRedis() {
  return request('/project/refreshredis', {
    method: 'GET',
  });
}
